class HoverContext {
    positionFunc = undefined
    dataFunc = undefined
  
    setPositionFunc(positionFunc) {
      this.positionFunc = positionFunc
    }
  
    setDataFunc(dataFunc) {
      this.dataFunc = dataFunc
    }
  
    setPosition(position) {
      this.positionFunc && this.positionFunc(position)
    }
  
    setData(data) {
      this.dataFunc && this.dataFunc(data)
    }
  }
  
  let hoverContext
  export const getHoverContext = () => {
    if (!hoverContext) {
      hoverContext = new HoverContext()
    }
    return hoverContext
  }
  